package com.example.zookeeper.rmi.client;

import com.example.zookeeper.rmi.service.HelloService;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

public class RmiClient
{

    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException
    {
        String uri = "rmi://localhost:1099/com.example.zookeeper.rmi.service.HelloService.HelloServiceImpl";
        HelloService helloService = (HelloService) Naming.lookup(uri);
        System.out.println(helloService.sayHello("rmiClient"));
    }
}
